/*
 *  $Id: PrayOfRestoration.cs 1051 2010-05-18 22:10:41Z thenn.erannor $
 *	This file is a part of Ragima CCG.
 *	(C) 2008 Ragima development group.
 *
 *	Licensed under the terms of the GNU GPL License version 2.
 *
 */

namespace Ragima.Cards001.Light.Spells {
    public class PrayOfRestoration: Abilities.Pray.PrayEnchantmentCard {
        public PrayOfRestoration(): base("001_l_s_pray_of_restoration") {
            Level = CompleteLevel.ReadyForTest;
            Element = ElementType.Light;
            Value = 100;
            AddManaCost(ElementType.Light, 3);
        }

        protected override EnchantmentAffect CreateEnchantment() {
            return new PrayOfRestorationAffect();
        }

        private class PrayOfRestorationAffect: EnchantmentAffect<PrayOfRestoration> {
            private static readonly Languages.CardPhrase<PrayOfRestoration> Action = new Languages.CardPhrase<PrayOfRestoration>("action");

            public PrayOfRestorationAffect() {
                Add(new Abilities.Pray.PrayBonus(DoPray));
            }

            private void DoPray(Creature prayer) {
                prayer.Owner.Game.Log.Add(Action.Phrase, prayer);
                int heal = Spells.DivinePresence.GetCoefficient(prayer.Owner);
                foreach (Creature cr in prayer.Owner.GetCreatures())
                    cr.HealBy(NewDamage(DamageType.Health, heal));
            }
        }
    }
}
